home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
LACE_14.ARJ
/
SET.DOC
< prev
next >
Wrap
Text File
|
1992-06-09
|
6KB
|
227 lines
SET.SYS and ENVIRON.SYS
Setting Environment Variables Inside CONFIG.SYS
A Companion Program to LACE
_______
____|__ | (tm)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER
Written by Keith Ledbetter
4240 Ketcham Drive
Chesterfield, VA 23832
(804) 674-0780
(6:00pm - 10:00pm Eastern Time)
Tech Support BBS: Blue Ridge Express
804-790-1675
30 Phone Lines (2400 bd)
Sub-board KEITHL
("J KEITHL")
Electronic mail on GEnie: ORION.MICRO
Compuserve: 72240,1221
AOL: KLedbetter
Program and Documentation are
Copyright (c) 1992 by Keith Ledbetter. All rights reserved.
Portions Copyright Borland, International.
Written with Borland C/C++ 3.0.
Introduction
------------
The ENVIRON.SYS and SET.SYS drivers included with your LACE
package allow you to set environment variables from inside your
CONFIG.SYS file. The LACE_SET program is used to retrieve these
settings and then place them in your master environment (normally
from your AUTOEXEC.BAT file).
How it Works
------------
Before you can SET environment variables, you must load the
ENVIRON.SYS device driver. This driver stays memory resident and
does the actual storage of the environment variables that you've
specified in your CONFIG.SYS file (you can set up to 128 bytes of
environment variables). The ENVIRON driver is very small, taking
up only around 280 bytes of your precious memory.
After loading ENVIRON.SYS, you merely call SET.SYS to set
environment variables. The syntax is identical to DOS's SET
command, as in:
device=c:\lace\SET.Sys The_Variable=The_Value
In your AUTOEXEC.BAT file, you then run the LACE_SET
program. This program does two things:
1. It sets the LACE variable automatically to the selection
number that you chose from LACE's boot-up menu.
2. It places any environment variables you set into the command
processor's master environment.
Setting Environment Variables from CONFIG.SYS Page 1
An Example
----------
In this example, we'll use the ASK device driver to prompt
the user for two configuration questions:
DOS = High
device = c:\qemm\qemm386.sys ram
shell = c:\4dos\4dos.com /p @c:\4dos\4dos.ini
device = c:\lace\environ.sys
device = c:\lace\lace.sys Center NumOff
device = LACE SelectionBarBackground=RED
device = LACE "S\tandard configuration"
device = d:\ms_mouse\mouse.sys /y /s30
device = c:\caches\mycache.sys 4096
device = c:\dos50\ansi.sys
device = c:\dos50\setver.exe
device = c:\lace\ask.sys "Load a RAMdisk? "
device = YES
device = c:\dos50\ramdrive.sys 2048
device = c:\lace\set.sys RAMDISK=YES
device = NO
device = c:\lace\set.sys RAMDISK=NO
device = END
device = c:\lace\ask.sys "Load the network? "
device = YES
device = c:\netlib\netdrvr.sys
device = c:\lace\set.sys NETWORK=YES
device = NO
device = c:\lace\set.sys NETWORK=NO
device = END
device = LACE "B\are-bones configuration"
device = c:\lace\set.sys RAMDISK=NO
device = c:\lace\set.sys NETWORK=NO
device = c:\dos50\ansi.sys
device = c:\dos50\setver.exe
device = LACE End
buffers = 5
files = 60
break = on
STACKS = 0,0
lastdrive = E
Setting Environment Variables from CONFIG.SYS Page 2
Then, in the AUTOEXEC.BAT file:
c:\lace\lace_set
...
... do whatever
...
if NOT "%RAMDISK%" == "YES" goto no_ramDISK
...
... load the ramdisk
...
:no_ramDISK
if NOT "%NETWORK" == "YES" goto no_network
...
... log onto the network
...
:no_network
...
... rest of your statements
In Conclusion
-------------
Don't forget that you MUST load the ENVIRON.SYS driver
before calling the SET.SYS driver. If you have any suggestions
for future enhancements, please don't hesitate to contact me
about them.
Enjoy!
Keith
Setting Environment Variables from CONFIG.SYS Page 3